package com.linked.gateway.config;

import java.util.List;
import java.util.Map;

/**
 * @author :dbq
 * @date : 2022/9/19 14:15
 */
public class GatewayRouterInfo {
    /**
     * 路由id
     */
    private String id;
    /**
     * 路由排序
     */
    private Integer order;

    /**
     * 跳转路由规则
     */
    private List<PredicateInfo> predicates;
    /**
     * 过滤器规则
     */
    private List<FilterInfo> filters;


    /**
     * 配置文件的Data Id
     */
    private String uri;

    public List<FilterInfo> getFilters() {
        return filters;
    }

    public void setFilters(List<FilterInfo> filters) {
        this.filters = filters;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getOrder() {
        return order;
    }

    public void setOrder(Integer order) {
        this.order = order;
    }

    public List<PredicateInfo> getPredicates() {
        return predicates;
    }

    public void setPredicates(List<PredicateInfo> predicates) {
        this.predicates = predicates;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public class PredicateInfo {

        private String name;

        private Map<String, String> args;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Map<String, String> getArgs() {
            return args;
        }

        public void setArgs(Map<String, String> args) {
            this.args = args;
        }

    }

    public class FilterInfo {

        private String name;

        private Map<String, String> args;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Map<String, String> getArgs() {
            return args;
        }

        public void setArgs(Map<String, String> args) {
            this.args = args;
        }

    }
}
